package com.ganee.agora.repository

import com.ganee.agora.api.MainApiService
import com.ganee.agora.model.FileEntity
import com.ganee.agora.model.InsertActivityEntity
import com.ganee.baselib.httprequest.callback.RequestCallback
import com.ganee.baselib.httprequest.callback.RequestMultiplyCallback
import com.ganee.baselib.mvvmlibrary.base.BaseRepository
import com.ganee.baselib.mvvmlibrary.base.BaseViewModel

import okhttp3.RequestBody

class PostEventRepository(baseViewModel: BaseViewModel<*>) : BaseRepository(baseViewModel) {

    /**
     * 发布活动
     */
    fun postEvent(body: RequestBody, callback:RequestCallback<InsertActivityEntity>) {
        executeQuietly(getApi(MainApiService::class.java).postEvent(body), callback)
    }

    /**
     * 上传文件
     */
    fun uploadFile(body: RequestBody, callback: RequestMultiplyCallback<FileEntity>) {
        executeQuietly(getApi(MainApiService::class.java).postUploadFile(body), callback)
    }
}
